#coding:utf-8
import functools
import logging as log


def logging(info,level=log.DEBUG,
                format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s',
                datefmt='%a, %d %b %Y %H:%M:%S',
                filename='./logging.log',
                filemode='a'):
    def perf_decotor(func):
        log.basicConfig(level=level,
                        format=format,
                        datefmt=datefmt,
                        filename=filename,
                        filemode=filemode)
        @functools.wraps(func)
        def actions(*args,**kwargs):
            log.info(info + '\t starting ..........')
            res=func(*args,**kwargs)
            log.info(info + '\t end ..........')
            return res
        return actions
    return perf_decotor

@logging('test......')
def test(info):
    print(info)

if __name__=="__main__":
    test('1111111111')